<?php
final class Task extends BaseRecordExt {
	
	//mapping table columns to constants
	const ID_TASK = "id_task";
	const DESCRIPTION = "description";
	const TABLE_NAME = "tasks";
	
	//constructor that sets the ID_TASK, DESCRIPTION keys into arrData
	function __construct(){
		parent::__construct();
		
		parent::addKey(self::ID_TASK);
		parent::addKey(self::DESCRIPTION);
		
	}
	
	//sets data into arrData
	public function setData($objArrData){
		parent::setData($objArrData);
		
		if(array_key_exists(self::ID_TASK, $objArrData) && array_key_exists(self::DESCRIPTION, $objArrData)){
			$this->setValue(self::ID_TASK, $objArrData[self::ID_TASK]);
			$this->setValue(self::DESCRIPTION, $objArrData[self::DESCRIPTION]);
		}else{
			echo("Task : objArrData's structure is faulty ");
		}
	}
	
	//returns the arrDataArray from parent
	public function getArrData(){
		return parent::getArrData();
	}
	
	//sets a value into the arrData
	public function setValue($key,$value){
		parent::setValue($key,$value);
	}
	
	//returns the value for the key in the arrData
	public function getValue($key){
		parent::getValue($key);
	}
	
}
?>